home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Musique / Quod Libet / quodlibet-3.3.0-installer.exe / bin / quodlibet / ext / events / autorating.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2014-12-31  |  1KB  |  24 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. from quodlibet.plugins.events import EventPlugin
  5.  
  6. class AutoRating(EventPlugin):
  7.     PLUGIN_ID = 'Automatic Rating'
  8.     PLUGIN_NAME = _('Automatic Rating')
  9.     PLUGIN_VERSION = '0.22'
  10.     PLUGIN_DESC = _("Rate songs automatically when they are played or skipped. This uses the 'accelerated' algorithm from vux by Brian Nelson.")
  11.     
  12.     def plugin_on_song_ended(self, song, skipped):
  13.         if song is not None:
  14.             rating = song('~#rating')
  15.             invrating = 1 - rating
  16.             delta = min(rating, invrating) / 2
  17.             if skipped:
  18.                 rating -= delta
  19.             else:
  20.                 rating += delta
  21.             song['~#rating'] = rating
  22.  
  23.  
  24.